<div class="admin_right_top">
<span style="float:left"><{$lang.album_cat_list}></span>
</div>
<div>
<{if !$smarty.get.edit}>
<table class="admin_table" border="0" cellspacing="1" bgcolor="#FFFFFF">
	<tr bgcolor="#E8E8E8" style="font-weight:bold" height="22">
	  <td width="10%" align="left"><{$lang.album_cat_cover}></td>
	  <td width="13%" align="left"><{$lang.album_cat_name}></td>
	  <td width="*%"  align="left"><{$lang.album_cat_des}></td>
	  <td width="22%" align="left"><{$lang.operation}></td>
	</tr>
	<{foreach item=list from=$re}>
	<tr>
	  <td align="left">
      <a href="?menu=<{$smarty.get.menu}>&action=m&m=album&s=admin_album&catid=<{$list.id}>">
      <{if $list.pic}>
	  	<img src="<{$list.pic}>" width="100" />
	  <{else}>
	  	<img src="image/default/nopic.gif" />
	  <{/if}>
      </a>
      </td>
	  <td valign="top"><{$list.name}>(<a href="?menu=<{$smarty.get.menu}>&action=m&m=album&s=admin_album&catid=<{$list.id}>"><b><{$list.count}></b></a>)</td>
	  <td valign="top"><{$list.des}></td>
	  <td valign="top">
        <a href="?menu=<{$smarty.get.menu}>&action=m&m=album&s=admin_album&catid=<{$list.id}>"><{$lang.up_pic}></a> | 
		<a href="?menu=<{$smarty.get.menu}>&action=m&m=album&s=admin_album_cat&edit=<{$list.id}>"><{$lang.edit}></a> | 
		<a href="?menu=<{$smarty.get.menu}>&action=m&m=album&s=admin_album_cat&deid=<{$list.id}>" onclick="return confirm('<{$lang.confirm}>');"><{$lang.del}></a>
        </td>
	</tr>
	<{foreachelse}>
	<tr><td align="center" colspan="4">还没有创建相册</td></tr>
	<{/foreach}>
  </table>
	<{/if}>


<form method="post" action="" enctype="multipart/form-data" onsubmit="return check_value();">
<table border="0" cellspacing="1" bgcolor="#FFFFFF" class="admin_table">
	<tr bgcolor="#e8e8e8" style="font-weight:bold" height="22">
	  <td colspan="2"><{if $smarty.get.edit && $re}><{$lang.album_cat_edit}><{else}><{$lang.album_album_cat_coverdd}><{/if}></td>
	</tr>
    <tr bgcolor="#f7f7f7"> 
        <td align="left" width="20%"><{$lang.album_cat_name}><span class="admin_red">*</span></td>
      <td width="80%">
          <input name="name" id="name" maxlength="50" type="text" style="width:300px;" value="<{if $smarty.get.edit && $re}><{$re.name}><{/if}>" />
		   </td>
    </tr>
    <tr bgcolor="#f7f7f7">
        <td align="left"><{$lang.album_cat_des}><span class="admin_red">*</span></td>
        <td>
            <textarea name="des" id="des" maxlength="50" style="width:300px;font-size:12px; height:60px;"><{if $smarty.get.edit && $re}><{$re.des}><{/if}></textarea>
		</td>
    </tr>
    <tr bgcolor="#f7f7f7">
        <td align="left">
            <input name="action" type="hidden" id="submit" value="<{if $smarty.get.edit && $re}>edit<{else}>submit<{/if}>" />        </td>
        <td>
            <input name="editid" type="hidden" value="<{$re.id}>" />
            <input type="submit" style="height: 22px;" value=" <{if $smarty.get.edit && $re}><{$lang.album_cat_edit}><{else}><{$lang.album_album_cat_coverdd}><{/if}>" /></td>
        </tr>
  </table>
  </form>
</div>
<script type="text/javascript">
function check_value()
{
	if(!$('name').value){
		alert('<{$lang.name_notice}>');
		$('name').focus();
		return false;
	}
	if(!$('des').value){
		alert('<{$lang.des_notice_req}>');
		$('des').focus();
		return false;
	}else if($('des').value.lenght>180){
		alert('<{$lang.des_notice_max}>');
		$('des').focus();
		return false;
    }
}
</script>
